<?php

class Add_Publish_Reply_SavePost_Validate_Acl extends Ext_Validate_Abstract
{
    
    public function __construct()
    {
    }
    
    public function isValid()
    {
        $userId = Ext_Auth_Front::getInstance()->getIdentity();
        $roleId = Ext_User::getInstance()->show($userId)->buildRole()->role->roleId;
        $acl = Ext_Acl::getInstance()->build($roleId);
        
        if(!$acl->isAllowed($roleId, 'article', 'reply')){
            $this->addMessage('Access denied.');
            return false;
        }
        
        return true;
    }
}
